<script type="text/javascript">
jQuery('document').ready(function() {
	jQuery('.preview').click(function() {
		cuisine_id = jQuery(this).attr('rel');
		thisSelf = jQuery(this); 
		thisSelf.parent().siblings('.preview_area').slideToggle('slow',function(){
			
			jQuery.ajax({
			  url: '<?php echo HOSTNAME;?>/cuisines/previewAlbum',
			  data: { cuisines:cuisine_id },
			  success: function(data) {
				thisSelf.parent().siblings('.preview_area').html(data);
			  }
			});
			
		});
		
		return false;
	});
	
	jQuery('.dishcount').click(function() {
		cuisine_id = jQuery(this).attr('rel');
		thisSelf = jQuery(this); 

		jQuery.ajax({
		  url: '<?php echo HOSTNAME;?>/cuisines/dishCount',
		  data: { cuisines:cuisine_id },
		  success: function(data) {
			thisSelf.html(data);
		  }
		});

		return false;
	});

	jQuery('.listdish').click(function() {
		cuisine_id = jQuery(this).attr('rel');
		thisSelf = jQuery(this); 

		jQuery.ajax({
		  url: '<?php echo HOSTNAME;?>/cuisines/listsDish',
		  data: { cuisines:cuisine_id },
		  success: function(data) {
			jQuery('.album_lists_container').html(data);
			jQuery('.album_lists').show();
		  }
		});

		return false;
	});
	

});
</script>
<?php
App::import('Model', 'Cuisine');
$this->Cuisine = new Cuisine();
$data = $this->Cuisine->latest(12);
?>
<div class="loading">&nbsp;</div>
<div class="album_lists">
	<div class="album_lists_close"><a href="#" class="close">CLOSE</a></div>
	<div class="album_lists_container">&nbsp;</div>
</div>
<div class="clearfix">				 
		<div id="grid">
			<div id="sort" style="position: relative; height: 1829px;">
				<?php
				foreach($data as $Cuisine) {
					$url_path = HOSTNAME.'/albums/cuisines/'.$Cuisine['Cuisine']['id'];
				?>
				<div class="box box-front<?php echo ($Cuisine['Cuisine']['is_featured'])?' featbox':'';?>">
					<div class="box_img">
						<a href="<?php echo $url_path?>"><img width="320" title="<?php echo $Cuisine['Cuisine']['title'];?>" alt="<?php echo $Cuisine['Cuisine']['title'];?>" class="thumbnail wp-post-image" src="<?php echo HOSTNAME.'/thumbs/?src=/app/webroot/img/cuisines/'.$Cuisine['Cuisine']['path'].'&w=300&zc=1&q=100';?>" style="opacity: 1;"></a>
						<h1><a href="<?php echo $url_path?>"><?php echo $Cuisine['Cuisine']['title'];?></a></h1>
					</div>

					<div class="boxcontrl">
						<a href="#" class="preview ctrl-prev" rel="<?php echo $Cuisine['Cuisine']['id'];?>">&nbsp;</a>
						<!-- <a href="#" class="dishcount" rel="<?php echo $Cuisine['Cuisine']['id'];?>">dish count?</a> -->
						<a href="#" class="listdish ctrl-lists" rel="<?php echo $Cuisine['Cuisine']['id'];?>">&nbsp;</a>
					</div>
					<div class="preview_area">&nbsp;</div>
					
					<div class="fb_like_index">
					<fb:like href="<?php echo $url_path;?>"
									   layout="button_count"
									   show_faces="false"
									   action="like"
									   colorscheme="light"></fb:like>
					</div>
					<p><?php echo $Cuisine['Cuisine']['description'];?></p>
					<a href="<?php echo $url_path?>" class="boxa"><span>See <?php echo $Cuisine['Cuisine']['album_count']; ?> dishes &raquo;</span></a>
					<!-- <p class="postmetadata"> Stack | <a rel="category tag" title="View all posts in Sculpture" href="#">Dishes</a>  </p> -->																				
				</div>				
				<?php } ?>			
			</div>
		</div>
</div>
<?php echo $this->element('facebook_api');?>